import React, { useState } from 'react'
import { View, Text, StyleSheet } from 'react-native'
import * as Animatable from 'react-native-animatable';
import { Button } from '../../components';
import { dp } from "../../utils"
type Props = {
  color?: string,
  type: string
}
const Flip = (props: Props) => {
  const [type, setType] = useState("")
  return (
    <View style={styles.mb}>
      <Animatable.View animation={type} onAnimationEnd={() => setType("")}>
        <Button color={props.color} style={styles.w336} onPress={() => setType(props.type)} type='primary'>{props.type}</Button>
      </Animatable.View>
    </View>
  )
}
const styles = StyleSheet.create({
  w336: {
    width: dp(336)
  },
  mb: {
    marginBottom: 20,
  },
})
export default Flip